<template>
	<view class="page" :style="themeColor">
		<view class="flex flex-direction flex-wrap align-stretch benben-position-layout flex afterShare_flex_0"
			:style="{height:(88+StatusBarRpx)+'rpx',paddingTop:StatusBarRpx+'rpx'}">
			<view class='flex flex-wrap align-center justify-between afterShare_fd0_0'>
				<view class='flex flex-wrap align-center afterShare_fd0_0_c0' @tap.stop="handleJumpDiy" data-type="back"
					data-url="1">
					<text class='fu-iconfont2  afterShare_fd0_0_c0_c0'>&#xe6a7;</text>
				</view>
				<view class='flex flex-wrap align-center'>
					<text class='afterShare_fd0_0_c1_c0'>注册</text>
				</view>
				<view class='flex align-center justify-end afterShare_fd0_0_c2'>
				</view>
			</view>

		</view>
		<view :style="{height: (88+StatusBarRpx)+'rpx'}"></view>
		<!---flex布局flex布局开始-->
		<view class="flex flex-direction flex-wrap align-stretch benben-flex-layout">
			<image class='afterShare_fd1_0' mode="aspectFit" :src='STATIC_URL+"111.png"'></image>
			<view class='flex flex-direction flex-wrap align-stretch afterShare_fd1_1'>
				<view class='flex flex-wrap align-center'>
					<text class='afterShare_fd1_1_c0_c0'>推荐人(邀请码)：</text>
					<text class='afterShare_fd1_1_c0_c1'>{{invite_code}}</text>
				</view>
				<view class='flex flex-wrap align-center afterShare_fd1_1_c1'>
					<input class='afterShare_fd1_1_c1_c0' type="number" placeholder="请输入手机号码"
						:maxlength="11" placeholder-style="color:rgba(191, 191, 191, 1);font-size:28rpx"
						v-model="mible" />
				</view>
				<view class='flex flex-wrap align-center justify-between afterShare_fd1_1_c2'>
					<input class='afterShare_fd1_1_c2_c0' type="number" placeholder="请输入验证码"
						:maxlength="6" placeholder-style="color:rgba(191, 191, 191, 1);font-size:28rpx"
						v-model="code" />
					<benben-send-verification-code class='flex  afterShare_fd1_1_c2_c1' after-text='后重新获取'
						before-text='获取验证码' type='1' :phone="mible"></benben-send-verification-code>
				</view>
				<view class='flex flex-wrap align-center registers_fd2_2'>
					<!-- <image class='registers_fd2_2_c0' mode="aspectFit" :src='STATIC_URL+"110.png"'></image> -->
					<benben-flex-password-diy v-model="password"
						class-name="flex align-center flex-sub flex registers_fd2_2_c1" :placeholder="'请输入密码(6~12位字母+数字)'"
						:maxlength="12" :default-type='true'
						placeholder-style="color:rgba(191, 191, 191, 1);font-size:28rpx">
						<template #show>
							<text class='fu-iconfont2  registers_fd2_2_c1_icon1' data-type="show">&#xE837;</text>
						</template>
						<template #hide>
							<text class='fu-iconfont2  registers_fd2_2_c1_icon2' data-type="hide">&#xEBCC;</text>
						</template>
					</benben-flex-password-diy>
				</view>
				
				
			</view>
			<button class='afterShare_fd1_2' @tap.stop="validationRegistrationFunc()">立即注册</button>
		</view>
		<!---flex布局flex布局结束-->
		<!-- <view class="flex flex-wrap align-center justify-center benben-position-layout flex afterShare_flex_2">
			<benben-flex-switch-new class-name='flex flex' v-model="is_tick" :disabled='false'>
				<template v-slot:checked>

					<view class='flex flex position-relative align-center'>
						<image class='afterShare_checkfd2_0_c0_c0' mode="aspectFit" :src='STATIC_URL+"33.png"'></image>
					</view>

				</template>
				<template v-slot:unchecked>

					<view class='flex flex position-relative justify-end align-center'>
						<image class='afterShare_noCheckfd2_0_c1_c0' mode="aspectFit" :src='STATIC_URL+"83.png"'>
						</image>
					</view>

				</template>
			</benben-flex-switch-new>
			<text class='afterShare_fd2_1'>已阅读并同意</text>
			<text class='afterShare_fd2_2' @tap.stop="handleJumpDiy" data-type="navigateTo"
				:data-url="`/pages/dlzc/userAgreement/userAgreement?type=1`">《用户注册协议》</text>
			<text class='afterShare_fd2_3'>与</text>
			<text class='afterShare_fd2_4' @tap.stop="handleJumpDiy" data-type="navigateTo"
				:data-url="`/pages/dlzc/userAgreement/userAgreement?type=2`">《隐私政策》</text>

		</view> -->
		<view :style="{height: '88rpx'}"></view>


	</view>
</template>
<script>
	import {
		validate
	} from '@/common/utils/validate.js'
	export default {
		components: {},


		data() {
			return {
				"fd1_1_c1_c0": "",
				"fd1_1_c2_c0": "",
				"fd1_1_c2_c1": "mobile",
				"is_tick": false,
				"mible": "",
				"code": "",
				"password": "",
				"invite_code": ""
			};
		},
		computed: {
			themeColor() {
				return this.$store.getters.themeColor
			},

		},
		watch: {},
		onLoad(options) {
			this.invite_code = options.invite_code;
		},
		onUnload() {

		},
		onReady() {

		},
		onShow() {

		},
		onHide() {

		},
		onResize() {

		},
		onPullDownRefresh() {

		},
		onReachBottom(e) {

		},
		onPageScroll(e) {

		},
		methods: {
			//效验注册
			async validationRegistrationFunc() {
				if (!validate(this.mible, 'require')) {
					this.$message.info('手机号不能为空');
					return false;
				}
				if (!validate(this.mible, 'phone')) {
					this.$message.info('请输入正确的手机号');
					return false;
				}
				if (!validate(this.code, 'require')) {
					this.$message.info('验证码不能为空');
					return false;
				}
				if (!validate(this.code, 'captcha')) {
					this.$message.info('请输入正确的验证码');
					return false;
				}
				if (!validate(this.password, 'require')) {
					this.$message.info('请输入密码');
					return false;
				}
				if (!validate(this.password, 'password')) {
					this.$message.info('请输入正确的密码');
					return false;
				}
				// if (this.is_tick === false) {
				// 	this.$message.info('请勾选协议');
				// 	return false;
				// }
				
				let data62e4f2138bd91 = await this.$api.post(global.apiUrls.post64366da220060, {
					mobile: this.mible,
					code: this.code,
					type: '1',
					password: this.password,
					invite_code: this.invite_code
				});
				if (data62e4f2138bd91.data.code != 1) {
					this.$message.info(data62e4f2138bd91.data.msg);
					return
				}
				this.$message.info('注册成功');
				setTimeout(() => {
					// window.location.href = 'https://app.yuntaikongtiao.com/h5/#/pages/homepage/download/download'
					uni.redirectTo({
						url: '/pages/homepage/download/download'
					})
				}, 800)
			}
		}
	};
</script>
<style lang="scss" scoped>
	
	.registers_fd2_2_c1_icon2 {
		text-align: center;
		font-size: 44rpx;
	}
	
	.registers_fd2_2_c1_icon1 {
		text-align: center;
		font-size: 44rpx;
		font-weight: 400;
		color: rgba(153, 153, 153, 1);
	}
	
	::v-deep .registers_fd2_2_c1 {
		font-size: 32rpx;
		color: #333;
		font-weight: 400;
		width: 680rpx;
		height: 110rpx;
		line-height: 110rpx;
	}
	
	.registers_fd2_2_c0 {
		width: 34rpx;
		height: 34rpx;
		margin: 0rpx 28rpx 0rpx 0rpx;
	}
	
	.registers_fd2_2 {
		border-bottom: 1px solid #eee;
	}
	.page {
		width: 100vw;
		overflow-x: hidden;
		min-height: calc(100vh - var(--window-bottom));
		background: #fff;
		background-size: 100% auto !important;
	}

	.afterShare_flex_0 {
		background: #fff;
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		top: 0rpx;
		background-size: 100% auto !important;
	}

	.afterShare_fd0_0_c2 {
		padding: 0rpx 0rpx 0rpx 0rpx;
		width: 200rpx;
	}

	.afterShare_fd0_0_c1_c0 {
		font-size: 36rpx;
		font-weight: 500;
		color: #333333;
	}

	.afterShare_fd0_0_c0_c0 {
		font-size: 30rpx;
		color: #333;
		font-weight: 500;
	}

	.afterShare_fd0_0_c0 {
		width: 200rpx;
	}

	.afterShare_fd0_0 {
		padding: 0rpx 32rpx 0rpx 32rpx;
		line-height: 88rpx;
	}

	.afterShare_fd1_2 {
		background: rgba(48, 131, 255, 1);
		border-radius: 44rpx 44rpx 44rpx 44rpx;
		font-size: 32rpx;
		color: #fff;
		width: 686rpx;
		height: 88rpx;
		margin: 63rpx 32rpx 0rpx 32rpx;
		font-weight: 700;
		line-height: 88rpx;
	}

	.afterShare_fd1_1_c2_c1 {
		line-height: 41rpx;
		text-align: center;
		font-size: 26rpx;
		color: #3083FF;
		border-radius: 21rpx 21rpx 21rpx 21rpx;
		font-weight: 400;
	}

	.afterShare_fd1_1_c2_c0 {
		width: 300rpx;
		font-size: 32rpx;
		font-weight: 400;
		line-height: 45rpx;
	}

	.afterShare_fd1_1_c2 {
		border-bottom: 1px solid #eee;
		padding: 32rpx 0rpx 32rpx 0rpx;
	}

	.afterShare_fd1_1_c1_c0 {
		font-size: 32rpx;
		font-weight: 400;
		line-height: 45rpx;
	}

	.afterShare_fd1_1_c1 {
		border-bottom: 1px solid #eee;
		padding: 32rpx 0rpx 32rpx 0rpx;
	}

	.afterShare_fd1_1_c0_c1 {
		color: #333333;
		font-size: 28rpx;
		font-weight: 700;
		line-height: 40rpx;
	}

	.afterShare_fd1_1_c0_c0 {
		color: #333333;
		font-size: 28rpx;
		font-weight: 700;
		line-height: 40rpx;
	}

	.afterShare_fd1_1 {
		color: #333333;
		font-size: 28rpx;
		line-height: 36rpx;
		font-weight: 700;
		padding: 32rpx 0rpx 40rpx 0rpx;
		margin: 0rpx 40rpx 0rpx 40rpx;
	}

	.afterShare_fd1_0 {
		width: 750rpx;
		height: 364rpx;
	}

	.afterShare_flex_2 {
		width: 750rpx;
		height: 88rpx;
		overflow: hidden;
		z-index: 10;
		bottom: calc(40rpx + var(--window-bottom));
	}

	.afterShare_fd2_4 {
		font-size: 24rpx;
		font-weight: 400;
		color: #333;
	}

	.afterShare_fd2_3 {
		font-size: 24rpx;
		font-weight: 400;
		color: rgba(153, 153, 153, 1);
	}

	.afterShare_fd2_2 {
		font-size: 24rpx;
		font-weight: 400;
		color: #333;
	}

	.afterShare_fd2_1 {
		font-size: 24rpx;
		font-weight: 400;
		color: rgba(153, 153, 153, 1);
		margin: 0rpx 0rpx 0rpx 16rpx;
	}

	.afterShare_noCheckfd2_0_c1_c0 {
		width: 32rpx;
		height: 32rpx;
	}

	.afterShare_checkfd2_0_c0_c0 {
		width: 32rpx;
		height: 32rpx;
	}
</style>